package com.szpx.service.impl;

import com.szpx.entity.settingentity.PriceSetting;
import com.szpx.entity.settingentity.SiteSetting;
import com.szpx.mapper.PriceSettingMapper;
import com.szpx.mapper.SiteSettingMapper;
import com.szpx.service.PriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional //事务处理策略
public class PriceServiceImpl implements PriceService {

    @Autowired
    private PriceSettingMapper priceSettingMapper;

    /**
     * 查询所有站点信息
     * @return
     */
    @Override
    public List<PriceSetting> selectAll() {
        return priceSettingMapper.selectAll();



    }

    /**
     * 新增站点
     * @param
     * @return
     */
    @Override
    public int add(PriceSetting priceSetting) {
        return priceSettingMapper.insert(priceSetting);
    }

    /**
     * 删除站点
     * @param id
     * @return
     */
    @Override
    public int delete(Integer id) {
        return priceSettingMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(PriceSetting priceSetting) {
        return priceSettingMapper.updateByPrimaryKeySelective(priceSetting);
    }
}
